package com.yykj.order.center.server.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Builder
@Table(
        indexes = {
                @Index(columnList = "consultationId")
        }
)
/**
 * 专家会诊订单 字段细节表,字段是动态的添加,一对多
 */
public class ConsultationDetail {

    @Id
    @Column(length = 32)
    @TableId(type = IdType.INPUT)
    public String id;

    @Column(columnDefinition = "varchar(32) NOT NULL COMMENT '会诊Id'" ,nullable = false)
    public String consultationId;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '字段Id'", nullable = true)
    public String columnId;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '字段名字'", nullable = true)
    public String columnName;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '字段Label'", nullable = true)
    public String columnLabel;

    @Column(columnDefinition = "varchar(2000) DEFAULT '' COMMENT '字段内容'", nullable = true)
    public String content;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '会诊结束后是否需要打印到报告上,1:需要 0:不需要'" ,nullable = true)
    public int needReport;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '排序'" ,nullable = true)
    public int sort;
}
